﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class user : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ((Label)this.Master.FindControl("lblsb")).Text = "用户搜索";
            if (Session["username"] == null)
            {
                Response.Redirect("default.aspx");
            }
            this.linkbtnUser.Text = Session["username"].ToString();
            this.lblUser.Text = Session["username"].ToString();
            this.lblLoginIp.Text = Request.ServerVariables["REMOTE_ADDR"].ToString();
            this.lblLoginLocation.Text = GlobalCls.GetIpLoc(this.lblLoginIp.Text);
            
            NVR.Entity.userInfo user = new NVR.Entity.userInfo();
            NVR.BLL.UserInfo userInfo = new NVR.BLL.UserInfo();
            NVR.BLL.NVRDevInfo nvr = new NVR.BLL.NVRDevInfo();
            
            user = userInfo.GetUserInfo(this.linkbtnUser.Text);

            this.lblSbNum.Text = nvr.GetNvrNums(this.linkbtnUser.Text).ToString();
            this.lblRegDate.Text = user.regDate.ToString();
            this.lblTel.Text = user.tel;
            this.lblQQ.Text = user.qq;
            this.lblEmail.Text = user.email;
        }
    }
    protected void linkBtn_Click(object sender, EventArgs e)
    {
        if (this.linkbtnUser.Text != "")
        {
            Response.Redirect("edituser.aspx?username=" + this.linkbtnUser.Text);
        }
    }
}
